Add environment-first new task flow on mobile - #4447
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2d96724 to
355a74a
Compare
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing workflow for creating tasks on mobile, adding an environment selection step as the first screen. New features that change navigation flows and add substantial new components warrant human review. You can customize Macroscope's approvability policy. Learn more. |
355a74a to
06d4dbd
Compare
61fee70 to
0bad292
Compare
0bad292 to
7013878
Compare
7013878 to
e3415f0
Compare
e3415f0 to
5651c88
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5651c88. Configure here.
An environment connection can stay `connected` while its shell subscription fails, which left the project picker rendering a spinner and "Loading projects" with no way to learn why projects never arrive. Report the shell error before falling through to the loading state, and keep cached snapshots on the existing empty-catalog message. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…icked The project picker showed the "Add environment" call to action whenever the chosen environment was not connected with a shell snapshot, so a still-loading or unreachable environment pushed users toward creating a new connection instead of working with the one they just selected. Derive the empty state action explicitly: no action while loading or while the selected environment is unavailable, "Add environment" only when no environment is selected, and "Add new project" once the selected environment is ready. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5f74802 to
49d2d83
Compare

What Changed
Why
This brings the mobile new-task flow in line with #4426: users explicitly choose where a task will run before choosing the project.
UI Changes
All shots: Android emulator (Pixel 6, API 35), light theme, same device and seeded environments for every image.
Environment-first new task flow (new behavior)
Step 1 — choose the environment:
Step 2 — choose a project, scoped to that environment:
Empty-state call to action when the selected environment is not ready
Same state in both images: an environment was already chosen from step 1, and its project list has not arrived yet.
Before — the picker offered "Add environment", pushing the user toward creating another connection instead of working with the one they had just selected:
After — no call to action while the selected environment is loading or unavailable; the back chevron to the environment picker is still the escape hatch:
Verification
vp test run apps/mobile/src/features/threads/newTaskPicker.test.ts(2 tests)vp run --filter @t3tools/mobile typecheckvp run lint:mobile(native linters unavailable on Linux; generated native projects skipped)vp check(zero errors; existing web warnings only)vp run typecheckNote
Medium Risk
Touches core new-task navigation, incoming-share resume paths, and environment-scoped project selection; regressions could mis-route shares or show wrong projects, but logic is largely extracted and covered by focused tests.
Overview
Adds an environment-first step to the mobile new-task sheet:
NewTaskEnvironmentRouteScreenis now the initial route, and the existing project picker becomesNewTaskProjectwith a requiredenvironmentId.Project choices are scoped to the selected environment via
buildNewTaskProjectItems/buildNewTaskEnvironmentItemsinnewTaskPicker.ts, so cross-machine repo grouping cannot pick the wrong target. Empty and loading states use per-environment shell state (useEnvironmentShellState) and no longer suggest “Add environment” while a chosen environment is still connecting.Navigation and share flows are updated: draft back-navigation returns to
NewTaskProjectwhen an environment was known; add-project can receiveenvironmentIdto preselect the environment. Unit tests cover scoping, counts, and empty-state actions.Reviewed by Cursor Bugbot for commit 49d2d83. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add environment-first new task flow on mobile
NewTaskEnvironmentRouteScreenas the first step in the new-task flow, letting users pick an environment before seeing projects. The project picker (NewTaskRouteScreen) is now scoped to a selectedenvironmentId.buildNewTaskEnvironmentItemsandbuildNewTaskProjectItemsin newTaskPicker.ts to filter environments (those with at least one project) and projects (scoped to a given environment).deriveNewTaskProjectPickerEmptyStateandderiveNewTaskProjectPickerActionto show environment-specific loading/error states and conditionally render add-project or add-environment actions.NewTaskDraftScreento navigate back to the environment-aware project picker (NewTaskProject) when an environment was initially specified, or to the environment picker otherwise.AddProjectSourceScreenand its route now accept an optionalenvironmentIdto preselect an environment when adding a project.Macroscope summarized 49d2d83.